package com.liu.lsm.sys.service.impl;

import com.liu.lsm.sys.entity.User;
import com.liu.lsm.sys.mapper.UserMapper;
import com.liu.lsm.sys.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserMapper userMapper;

    @Override
    public void deleteById(Integer id) {
        userMapper.deleteById(id);
    }

    @Override
    public void insert(User user) {
        userMapper.insert(user);
    }

    @Override
    public User selectByUsername(String username) {

        return userMapper.selectByUsername(username);
    }

    @Override
    public void updateById(User user) {
        userMapper.updateById(user);
    }

    @Override
    public User getById(Integer id){
        return  userMapper.getById(id);
    }
}
